magnifier: Use gtk_widget_set_overflow()
authorBenjamin Otte <otte@redhat.com>
Fri, 8 Feb 2019 17:16:07 +0000 (18:16 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 8 Feb 2019 17:26:42 +0000 (18:26 +0100)
gtk/gtkmagnifier.c

index fce0f0399bc03684e8f9fb312e86c9d2165b9aa8..0ddbdd882c6ded7785385872f82ce38233785ce0 100644 (file)
@@ -116,9 +116,6 @@ gtk_magnifier_snapshot (GtkWidget   *widget,
   if (paintable_width <= 0.0 || paintable_height <= 0.0)
     return;
 
-  gtk_snapshot_push_clip (snapshot,
-                          &GRAPHENE_RECT_INIT (0, 0, width, height));
-
   graphene_matrix_init_translate (&transform, &GRAPHENE_POINT3D_INIT (
                                  - CLAMP (priv->x, 0, paintable_width),
                                  - CLAMP (priv->y, 0, paintable_height),
@@ -132,8 +129,6 @@ gtk_magnifier_snapshot (GtkWidget   *widget,
   gtk_snapshot_push_transform (snapshot, &transform);
   gdk_paintable_snapshot (priv->paintable, snapshot, paintable_width, paintable_height);
   gtk_snapshot_pop (snapshot);
-
-  gtk_snapshot_pop (snapshot);
 }
 
 static void
@@ -218,6 +213,8 @@ gtk_magnifier_init (GtkMagnifier *self)
   GtkWidget *widget = GTK_WIDGET (self);
 
   gtk_widget_set_has_surface (widget, FALSE);
+  gtk_widget_set_overflow (widget, GTK_OVERFLOW_HIDDEN);
+
   priv->magnification = 1;
   priv->resize = FALSE;
   priv->paintable = gtk_widget_paintable_new (NULL);